package com.tangyuan.user.controller;

import com.tangyuan.common.constant.RedisConstant;
import com.tangyuan.common.result.Result;
import com.tangyuan.dto.UserHonouredGuestDto;
import com.tangyuan.model.User;
import com.tangyuan.user.service.IHonouredGuestService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: honoured_guest
 * @Author: jeecg-boot
 * @Date:   2024-03-20
 * @Version: V1.0
 */
@Api(tags="honoured_guest")
@RestController
	@RequestMapping("/user/honouredGuest")
@Slf4j
public class HonouredGuestController {
	@Autowired
	private IHonouredGuestService honouredGuestService;


	//根据用户查询所有嘉宾
	 @GetMapping("/getMyhonouredGuest")
	 public Result getMyHonouredGuest(@RequestHeader(name = "userId", required = false) Long userId,
									  @RequestParam Integer pageNum,
									  @RequestParam Integer pageSize){
		 return honouredGuestService.getMyHonouredGuest(userId,pageNum,pageSize);
	 }
	//根据id查询所有嘉宾
	@GetMapping("/getMyhonouredGuestById")
	public Result getMyHonouredGuestById(@RequestParam Integer id){
		return honouredGuestService.getMyHonouredGuestById(id);
	}

	 //根据用户id查询所有活动
	 @GetMapping("/getMyactive")
	 public Result getMyActive(@RequestHeader(name = "userId", required = false) Long userId,
									  @RequestParam Integer pageNum,
									  @RequestParam Integer pageSize){
		 return honouredGuestService.getMyActive(userId,pageNum,pageSize);
	 }
	 //添加嘉宾
	 @PostMapping("/addhonouredGuest")
	public Result addHonouredGuest(@RequestBody UserHonouredGuestDto userHonouredGuestDto,
								   @RequestHeader(name = "userId", required = false) Long userId){
		 return honouredGuestService.addHonouredGuest(userHonouredGuestDto,userId);
	 }
	 //作品添加
	 @PostMapping("/addactive")
	 public Result addActive(@RequestBody UserHonouredGuestDto userHonouredGuestDto,
									@RequestHeader(name = "userId", required = false) Long userId){
		 return honouredGuestService.addActive(userHonouredGuestDto,userId);
	 }
	//嘉宾作品删除
	@GetMapping("/removehonouredGuest")
	public Result removeHonouredGuest(@RequestParam Integer id){
		return honouredGuestService.removeHonouredGuest(id);
	}


}
